package com.ap.generator.messageheader;

import com.ap.core.cxf.jaxb.msghdr.AbstractMsgHdrTypeGeneratorBuilder;
import com.ap.core.cxf.jaxb.msghdr.MessageType;

import static com.ap.datagen.core.GeneratorHelper.fixedValueGenerator;
import static com.ap.datagen.core.GeneratorHelper.randomGeneratorFromEnum;
import static com.ap.datagen.core.Nullable.nullable;
import static com.ap.datagen.date.JodaLocalDateTimeGeneratorBuilder.jodaLocalDateTimeGeneratorBuilder;
import static com.ap.datagen.lang.StringRandomGeneratorBuilder.stringRandomGeneratorBuilder;

/**
 *
 */
public class MsgHdrTypeGeneratorBuilder extends AbstractMsgHdrTypeGeneratorBuilder {
    @Override
    public void setupDefaults() {
        this.msgIdGenerator = nullable(stringRandomGeneratorBuilder().length(16).build());
        this.msgTimestampGenerator = nullable(jodaLocalDateTimeGeneratorBuilder().build());
        this.msgTypeGenerator = nullable(randomGeneratorFromEnum((MessageType.SUBMITRTPFORMOB)));
    }

    public static MsgHdrTypeGeneratorBuilder msgHdrTypeGenerator() {
        return new MsgHdrTypeGeneratorBuilder();
    }

    public MsgHdrTypeGeneratorBuilder withMsgType(MessageType value) {
        this.msgTypeGenerator = nullable(fixedValueGenerator(value));
        return this;
    }
    
}
